<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>敢敢二手商城</title>
<link type="text/css" href="css/css.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/js.js"></script>
</head>

<body style=" background:#FFF;">
 <div class="loginLogo">
  <div class="logoMid">
   <h1 class="logo" style="height:71px;padding-top:10px;"><a href="index.html"><img src="images/04.jpg" width="241" height="71" /></a></h1>
  </div><!--logoMid/-->
 </div><!--loginLogo/-->
 <div class="loginBox">
  <img src="images/chengnuo.jpg" width="295" height="393" class="chengnuo" />
  <form class="reg" id="RegisterForm">
   <div class="regList">
    <label><span class="red">*</span> 账户名</label>
    <input type="text" name="username" /> <span style="color:#999;">请输入邮箱/用户名/手机号</span>
   </div><!--regList/-->
   <div class="regList">
    <label><span class="red">*</span> 请设置密码</label>
    <input type="password" name="password" />
   </div><!--regList/-->
   <div class="regList">
    <label><span class="password">*</span> 请确认密码</label>
    <input type="text" />
   </div><!--regList/-->
   <div class="reg">
    <a><input type="image" src="images/reg.jpg" width="284" height="34" id="submit" /></a>
   </div><!--reg/-->
  </form><!--reg/-->
  <div class="clears"></div>
 </div><!--loginBox/-->
</body>
<script>
 $("#submit").click(function () {
  $.ajax({
   type: 'POST',
   url: 'http://localhost:8080/api/register',
   data: $("#RegisterForm").serialize(),
   success: function () {
    alert("注册成功");
    window.location.href = "/login.html";
   },
   error: function () {
    alert("注册失败")
   }
  })
 })
</script>
</html>
